const app = getApp();
const post = app.post
const get = app.get
const uploadFile = app.uploadFile

// 装修流程
export const _get_adorn_process = (cb) => {
  let url = 'member/adorn_process/'
  let data = {}
  get(url, data, cb)
}
// 详情 一级关联文章
export const _get_adorn_process_detail = (processId, cb) => {
  let url = 'member/adorn_process/' + processId + '/'
  let data = {}
  get(url, data, cb)
}
// 装修服务
export const _get_adorn_service = (cb) => {
  let url = 'member/adorn_service/'
  let data = {}
  get(url, data, cb)
}
// 预约服务
export const _order_adorn_service = (name, mobile, address, code, cb) => {
  let url = 'member/adorn_service/order/'
  let data = {
    name: name,
    mobile: mobile,
    address: address,
    code: code
  }
  post(url, data, cb)
}
// 装修大全
// 分类字典
export const _get_adorn_pedia_dict = (cb) => {
  let url = 'member/adorn_pedia/'
  let data = {}
  get(url, data, cb)
}
// 百科详情detail/
export const _get_adorn_pedia_detail = (id, cb) => {
  let url = 'member/adorn_pedia/' + id + '/detail/'
  let data = {}
  get(url, data, cb)
}
// 百科详情图片/
export const _get_adorn_pedia_imgs = (id, data, cb) => {
  let url = 'member/adorn_pedia/imgs/?adorn_pedia=' + id
  get(url, data, cb)
}
// 产品分类
export const _get_product_dict = (cb) => {
  let url = 'member/product/dict/'
  let data = {}
  get(url, data, cb)
}
// 推荐和热门产品列表
export const _get_hot_recommend_product = (data, cb) => {
  let url = 'member/product/hot_recommend/'
  get(url, data, cb)
}
// 产品列表
export const _get_product_list = (data, cb) => {
  let url = 'member/product/'
  get(url, data, cb)
}
// 产品分类页数据
export const _get_category_product_list = (cb) => {
  let url = 'member/product/category_products/'
  get(url, {}, cb)
}
//获取产品详情
export const _getproduct_info = (id, cb) => {
  let url = 'member/product/' + id + '/'
  let data = {}
  get(url, data, cb)
}
export const _getproduct_detail = (id, cb) => {
  let url = 'member/product/' + id + '/details/'
  let data = {}
  get(url, data, cb)
}
// 工人列表
export const _get_worker_list = (cb) => {
  let url = 'member/worker/'
  let data = {}
  get(url, data, cb)
}
// 文章列表
export const _get_article_list = (data, cb) => {
  let url = 'member/article/'
  // let data = {}
  get(url, data, cb, false)
}
// 文章详情
export const _get_article_detail = (id, cb) => {
  let url = 'member/article/' + id + '/'
  let data = {}
  get(url, data, cb)
}
// 文章评论
export const _get_article_comments = (article_id, data, cb) => {
  let url = 'member/comment/article/?article=' + article_id
  // let data = {}
  get(url, data, cb)
}
// 文章点赞
export const _article_like = (article_id, cb) => {
  let url = 'member/article/' + article_id + '/like/'
  let data = {}
  get(url, data, cb)
}
// 文章收藏
export const _article_collect = (article_id, cb) => {
  let url = 'member/article/' + article_id + '/collect/'
  let data = {}
  get(url, data, cb)
}
// 案例列表
export const _get_project_case_list = (data, cb) => {
  let url = 'member/project_case/'
  // let data = {}
  get(url, data, cb)
}
// 案列分类
export const _get_project_case_dcit = (cb) => {
  let url = 'member/project_case/dict/'
  let data = {}
  get(url, data, cb)
}
// 案例详情
export const _get_project_case_detail = (id, cb) => {
  let url = 'member/project_case/' + id + '/'
  let data = {}
  get(url, data, cb)
}
// 收藏案例
export const _project_case_collect = (house_id, cb) => {
  let url = 'member/project_case/' + house_id + '/collect/'
  let data = {}
  get(url, data, cb)
}

// 发送验证码
export const _send_vcode = (mobile, cb) => {
  let url = 'member/send/vcode/'
  let data = { mobile: mobile }
  post(url, data, cb)
}
// 注册登录login_regist
export const _login_regist = (mobile, vcode, userInfo, cb) => {
  let url = 'member/token/obtain/'
  let data = { mobile: mobile, vcode: vcode, userInfo: userInfo }
  post(url, data, cb)
}
export const _username_login_regist = (data, cb) => {
  let url = 'member/username_register/'
  post(url, data, cb)
}
// 评论
export const _send_comment = (content, article_id, cb) => {
  let url = 'member/comment/'
  let data = { content: content, article_id: article_id }
  post(url, data, cb)
}
// 评论点赞
export const _comment_like = (comment_id, cb) => {
  let url = 'member/comment/' + comment_id + '/like/'
  let data = {}
  get(url, data, cb)
}
// 圈子
export const _circle_houses = (cb) => {
  let url = 'member/circle/houses/'
  let data = {}
  get(url, data, cb)
}
// 圈子图片删除上传
export const _circle_houses_img_upload = (filePath, cb) => {
  let url = 'member/circle/upload_image/'
  uploadFile(filePath, url, cb)
}
// 圈子发布
export const _circle_issue = (data, cb) => {
  let url = 'member/circle/'
  post(url, data, cb)
}
// 圈子列表
export const _get_circle_list = (data, cb) => {
  let url = 'member/circle/list/'
  get(url, data, cb)
}

// 圈子详情
export const _get_circle_detail = (id, cb) => {
  let url = 'member/circle/' + id + '/detail/'
  get(url, {}, cb)
}

// 圈子点赞
export const _get_circle_like = (id, cb) => {
  let url = 'member/circle/' + id + '/like/'
  get(url, {}, cb)
}
//发布圈子评论
export const _issue_circle_comment = (id, data, cb) => {
  let url = 'member/circle/' + id + '/comment/'
  post(url, data, cb)
}

//圈子评论s
export const _get_circle_comments = (data, cb) => {
  let url = 'member/circle/comment/list/'
  get(url, data, cb)
}
//圈子评论点赞
export const _get_circle_comment_like = (comment_id, cb) => {
  let url = 'member/circle/comment/' + comment_id + '/like/'
  get(url, {}, cb)
}

// 用户房子
export const _get_member_house = (cb) => {
  let url = 'member/house/'
  get(url, {}, cb)
}
// 添加或者修改
export const _create_member_house = (data, cb) => {
  let url = 'member/house/'
  post(url, data, cb)
}

// 用户房子
export const _get_member_collections = (data,cb) => {
  let url = 'member/collections/'
  get(url, data, cb)
}